package com.car.carmgr.bean;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Menu {

    private Integer id;

    @JsonProperty("parentId")
    private Integer pid;

    @JsonProperty("title")
    private String name;
    private String href;
    private Integer open;
    private String target;
    private String icon;
    private Integer available;

    private Boolean spread;

    private List<Menu> children=new ArrayList<>();

    //分配权限（菜单）
    private String checkArr = "0";

    public Boolean getSpread() {
        if(open != null && open == 1){
            return true;
        }
        return false;
    }
}
